<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
    <style>
      .box {
        position: relative;
        width: 100%;
        height: 700px;
        background-color: aqua;
      }
      .demo1 {
        /*相对定位与绝对定位相结合*/
        position: absolute;
        left: 0;
        top: 0;
        width: 200px;
        height: 200px;
        background-color: rgb(49, 38, 214);
      }
      .demo2 {
        /*相对定位与绝对定位相结合*/
        position: absolute;
        left: 80%;
        top: 0;
        width: 200px;
        height: 200px;
        background-color: rgb(49, 46, 212);
      }
      .box:hover .demo1 {
        /*当鼠标悬挂到box的区域内 发生对demo1的过渡效果*/
        left: 300px;
        top: 300px;
        background-color: purple;/*位置和背景色都发生过渡变化*/

        /*所有对象 过渡持续4s 匀速 延迟1s*/
        -webkit-transition: all 4s linear 1s;
        -moz-transition: all 4s linear 1s;
        -ms-transition: all 4s linear 1s;
        -o-transition: all 4s linear 1s;
        transition: all 4s linear 1s;
      }
      .box:hover .demo2 {
        left: 300px;
        top: 300px;
        background-color: yellow;

        /*所有对象 过渡持续4s 先慢后快再慢 延迟1s*/
        -webkit-transition: all 4s ease 1s;
        -moz-transition: all 4s ease 1s;
        -ms-transition: all 4s ease 1s;
        -o-transition: all 4s ease 1s;
        transition: all 4s ease 1s;
      }
    </style>
  </head>
  <body>
    <div class="box">
      <div class="demo1"></div>
      <div class="demo2"></div>
    </div>
  </body>
</html>
